package com.zeta.eduservice.controller.question;


import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zeta.commonutils.R;
import com.zeta.eduservice.entity.question.EduCoursequestionlistInfo;
import com.zeta.eduservice.service.EduCoursequestionlistInfoService;

/**
 * <p>
 * 课程习题类型信息 前端控制器
 * </p>
 *
 * @author zeta
 * @since 2020-11-03
 */
@CrossOrigin
@RestController
@RequestMapping("/eduservice/edu_coursequestionlist_info")
public class EduCoursequestionlistInfoController {

	@Autowired
	EduCoursequestionlistInfoService courseQuestionService;
	@GetMapping("{id}")
	public R get(@PathVariable String id) {
		QueryWrapper<EduCoursequestionlistInfo> queryWrapper=new QueryWrapper<EduCoursequestionlistInfo>();
		queryWrapper.eq("course_id", id);
		List<EduCoursequestionlistInfo> listinfo = courseQuestionService.list(queryWrapper);
		List<String> list=new ArrayList<String>();
		for(EduCoursequestionlistInfo i:listinfo) {
			list.add(i.getType());
		}
		return R.ok().data("list", list);
	}
}

